﻿function summit_delete_log(ID) {
    $("#dialog-confirm").removeClass('hide').dialog({
        resizable: false,
        modal: true,
        title: "<div class='widget-header'><h4 class='smaller'><i class='icon-warning-sign red'></i>删除日志</h4></div>",
        title_html: true,
        buttons: [
            {
                html: "<i class='icon-trash'></i>&nbsp; 删除",
                "class": "btn btn-danger btn-xs",
                click: function () {
                    var s = "";
                    s = $.ajax({
                        type: "POST",
                        url: "AjaxAction.ashx",
                        data: {
                            dowhat: "delete_log",
                            UserName: $("#UserName").val(),
                            UserIP: $("#UserIP").val(),
                            ID: ID
                        },
                        async: false
                    }).responseText;
                    if (s == "success") {
                        window.location.href = "Default.aspx" + location.search;
                    }
                }
            }
            ,
            {
                html: "<i class='icon-remove'></i>&nbsp; 取消",
                "class": "btn btn-xs",
                click: function () {
                    $(this).dialog("close");
                }
            }
        ]
    });
};
function summit_deletes_log() {
    $("#delete_tips").remove(); $(".alert-danger").remove(); $(".space-6").before("<div class=\"alert alert-info bigger-110\" id=\"delete_tips\"> 删除操作执行后不可恢复</div>");
    $("#dialog-confirm").removeClass('hide').dialog({
        resizable: false,
        modal: true,
        title: "<div class='widget-header'><h4 class='smaller'><i class='icon-warning-sign red'></i>批量删除日志</h4></div>",
        title_html: true,
        buttons: [
            {
                html: "<i class='icon-trash'></i>&nbsp; 批量删除",
                "class": "btn btn-danger btn-xs",
                click: function () {
                    var s = "";
                    s = $.ajax({
                        type: "POST",
                        url: "AjaxAction.ashx",
                        data: {
                            dowhat: "deletes_log",
                            days: $("#spinner").val(),
                            UserName: "",
                            UserIP: "",
                        },
                        async: false
                    }).responseText;
                    if (s == "success") {
                        window.location.href = "Default.aspx" + location.search;
                    }
                    else { $("#delete_tips").remove(); $(".alert-danger").remove(); $(".space-6").before("<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><i class='icon-remove'></i></button><small><strong><i class='icon-fire'></i>&nbsp;&nbsp;&nbsp;&nbsp;提示!</strong> 没有匹配的日志记录。</small></div>"); }
                }
            }
            ,
            {
                html: "<i class='icon-remove'></i>&nbsp; 取消",
                "class": "btn btn-xs",
                click: function () {
                    $(this).dialog("close");
                }
            }
        ]
    });
}